﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Atechnology.glassCAD.Shapes
{
    public class Ellipse : IFigure
    {
        private float a = 1;

        public float A
        {
            get { return a; }
            set { a = value; }
        }

        private float b = 1;

        public float B
        {
            get { return b; }
            set { b = value; }
        }

        public Ellipse()
        {
        }

        public PointF GetOffsetPoint(float offset)
        {
            return this.GetAnglePoint(2 * offset * Math.PI);
        }

        public PointF GetAnglePoint(double angle)
        {
            float _angle = (float)(angle % (2 * Math.PI));
            PointF result = new PointF((float)(this.a / 2 * Math.Cos(_angle)), (float)(this.b / 2 * Math.Sin(_angle)));
            return result;
        }
    }
}
